<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('标准农事列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>

                        <li>
                            标准id：<input type="text" name="standardId"/>
                        </li>

                        <li>
                            阶段id：<input type="text" name="stageId"/>
                        </li>

                        <li>
                            农事名称：<input type="text" name="workName"/>
                        </li>

                        <li>
                            农事类型 1:栽培 2：农资：<input type="text" name="workType"/>
                        </li>

                        <li>
                            循环周期(天)：<input type="text" name="cycleDays"/>
                        </li>

                        <li>
                            第几天开始：<input type="text" name="workStart"/>
                        </li>

                        <li>
                            第几天结束：<input type="text" name="workEnd"/>
                        </li>

                        <li>
                            动态调整 0: 不是 1：是：<input type="text" name="isDynamic"/>
                        </li>

                        <li>
                            农资名称：<input type="text" name="inputCn"/>
                        </li>

                        <li>
                            农资：<input type="text" name="input"/>
                        </li>

                        <li>
                            数量/亩：<input type="text" name="inputCount"/>
                        </li>

                        <li>
                            单位：<input type="text" name="inputUnit"/>
                        </li>

                        <li>
                            工作内容：<input type="text" name="workDetail"/>
                        </li>

                        <li>
                            创建时间：<input type="text" name="createTime"/>
                        </li>

                        <li>
                            创建者：<input type="text" name="createBy"/>
                        </li>

                        <li>
                            备注：<input type="text" name="remark"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncWork:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="system:ncWork:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:ncWork:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncWork:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncWork:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncWork:remove')}]];
    var prefix = ctx + "system/ncWork";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "标准农事",
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'workId',
                    title: '农事id',
                    visible: false
                },
                {
                    field: 'workName',
                    title: '农事名称',
                    sortable: true
                },
                {
                    field: 'workType',
                    title: '农事类型',
                    sortable: true
                },
                {
                    field: 'cycleDays',
                    title: '循环周期(天)',
                    sortable: true
                },
                {
                    field: 'workStart',
                    title: '第几天开始',
                    sortable: true
                },
                {
                    field: 'workEnd',
                    title: '第几天结束',
                    sortable: true
                },
                {
                    field: 'isDynamic',
                    title: '动态调整',
                    sortable: true
                },
                {
                    field: 'inputCn',
                    title: '农资名称',
                    sortable: true
                },
                {
                    field: 'inputCount',
                    title: '数量/亩',
                    sortable: true
                },
                {
                    field: 'inputUnit',
                    title: '单位',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.workId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.workId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>